#include<iostream>
using namespace std;
int main()
{
    int sum,n,A,b=1;
    cout<<"n=?"<<endl;
    cin>>n;
    while(n>0)
    {
      for(A=1;A<=n;A++)
      {
       b=b*A;
      }
      sum+=b;
      n--;
      b=1;
    }  
 cout<<sum<<endl;
 return 0;
}